from http.server import HTTPServer, SimpleHTTPRequestHandler

def run(server_class=HTTPServer, handler_class=SimpleHTTPRequestHandler, port=8001):
    server_address = ('', port)
    httpd = server_class(server_address, handler_class)
    print(f'启动服务器在端口 {port}...')
    print(f'请访问 http://localhost:{port}')
    httpd.serve_forever()

if __name__ == '__main__':
    run()